home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_013 / dynamictriangle.bas < prev    next >
BASIC Source File  |  1992-05-06  |  1KB  |  37 lines

  1.  
  2.  
  3.  
  4. Type P to Pause, S to Stop listing
  5.  
  6. 1 rem DYNAMIC TRIANGLE" for the AMIGA
  7. 2 rem by Earl Hamner
  8. 3 rem 26 Oct 85
  9. 4 rem A study in Graphics
  10. 5 rem =======================================
  11. 10 scnclr:screen 1,4,0 rem 80 col screen  4 deep (16 colors)
  12. 20 font 1:width 80
  13. 30 rgb 0,0,0,0 rem screen
  14. 40 rgb 1,13,9,9 rem text
  15. 50 rgb 2,15,0,0 rem border
  16. 60 print "hit return to quit"
  17. 70 print "hit l. mouse button to change color; hold to cycle color"
  18. 80 print "hit zero to clear screen"
  19. 90 outline 1
  20. 100 x=318:y=92:a=x:b=y:c=x:d=y
  21. 110 def fnx(x)=int(rnd(1)*x)+1
  22. 120 dx=fnx(9):dy=fnx(4)
  23. 130 da=4:db=5
  24. 140 dc=fnx(4):dd=fnx(5)
  25. 200 pena cc:area (x,y to a,b to c,d)
  26. 210 ask mouse w%,r%,t%:if t%=4 then cc=fnx(15)
  27. 220 x=x+dx:if x<0 or x>315 then dx=-dx:x=x+dx*2
  28. 240 y=y+dy:if y<0 or y>183 then dy=-dy:y=y+dy*2
  29. 250 a=a+da:if a<0 or a>315 then da=-da:a=a+da*2
  30. 260 b=b+db:if b<0 or b>183 then db=-db:b=b+db*2
  31. 270 c=c+dc:if c<0 or c>315 then dc=-dc:c=c+dc*2
  32. 280 d=d+dd:if d<0 or d>183 then dd=-dd:d=d+dd*2
  33. 290 get a$:if a$= chr$(13) then scnclr: end
  34. 300 if a$= "0" then scnclr
  35. 310 goto 20
  36. Type Selection or M for list, 
  37. P to set protocol, <CR> to exit: